{include app:admin.inc.header}
<!--tmpl-resource-->
{include app:admin.inc.top}


<div class="container-fluid content-body">
	<div class="main">
		<!-- left side start-->
		{include admin.inc.menu}
		<!-- left side end-->


		<!-- main content start-->
		<section class="right-section" id="right-section">
			<!-- start of inner-frame -->
			<div class="inner-iframe">

				<!-- page breadcrumb start-->
				{include admin.inc.bread}
				<!-- page "breadcrumb end-->
				<!-- Nav tabs -->
				<ul class="nav nav-tabs">

					<li><a href="{$add_url}"><i class="glyphicon glyphicon-plus"></i> 添加友情链接</a></li>
					<li class="active"><a href="javascript:void(0);"><i class="glyphicon glyphicon-th-list"></i> 友情链接列表</a></li>
					<li ><a href="{url /admin/friendLinkCate/index}"><i class="glyphicon glyphicon-th-list"></i> 分类列表</a></li>
					<!--<li><a href="/admin/index/edit"><i class="glyphicon glyphicon-edit"></i> 编辑友情链接</a></li>-->

				</ul>
				<div class="inner-container">
					<form class="form-inline search-form" role="form">
						<!-- search form start -->
						<!--tmpl-search-->

						<!-- searchinput -->
						<div class="form-group">
							<div class="input-group">
								<div class="input-group-addon">
									标题
								</div>
								<input type="text" class="form-control input-sm" maxlength="50" placeholder="标题" name="s_title" value="{$s_title}">
							</div>
						</div>
						
						<!-- searchselectscript -->
						<div class="form-group">
							<div class="input-group">
								<div class="input-group-addon">
									分类
								</div>
								<select id="s_catid" class="form-control input" name="s_catid">
									<option value="">-- 请选择 --</option>
									{loop $catidoptions $v}
									<option {if $item[catid] == $v[id]}selected{/if} value="{$v[id]}">{$v[name]}</option>
									{/loop}
								</select>
							</div>
						</div>
						<!-- searchselectscript -->
						<div class="form-group">
							<div class="input-group">
								<div class="input-group-addon">
									类型
								</div>
								<select id="s_type" class="form-control input" name="s_type">
									<option value="">-- 请选择 --</option>
									<option {if $s_type===0}selected="selected"{/if} value="0">文字</option>
									<option {if $s_type==1}selected="selected"{/if} value="1">图片</option>
								</select>
							</div>
						</div>
						
						
						<!-- searchselectscript -->
						<div class="form-group">
							<div class="input-group">
								<div class="input-group-addon">
									状态
								</div>
								<select id="s_status" class="form-control input" name="s_status">
									<option value="">-- 请选择 --</option>
									<!--tmpl-options-->
									<!-- option -->
									<option  {if $s_status===0}selected="selected"{/if} value="0">禁用</option>
									<!-- option -->
									<option {if $s_status==1}selected="selected"{/if} value="1">启用</option>
						
								</select>
							</div>
						</div>
						

						<input type="hidden" name="order" value="{$order}">
						<button type="submit" class="btn btn-sm btn-success">搜索</button>
						<!-- search form end -->
					</form>
					<form id="J_List_Form">
						<div class="table-responsive">
							<table id="J_ListTable" class="table  table-hover  table-striped">
								<!--tmpl-listtable-->

								<!-- listblock -->
								<thead>
									<tr>
										<th width="20"><input type="checkbox" class="icheck check-all" /></th>
										<!--tmpl-fieldheaders-->
								
										<th>标题<!--tmpl-orderth-->
										
										&nbsp;<i data-val='{if $order=="title ASC"}title DESC{else}title ASC{/if}' class='fa ofield {if $order=="title ASC"}fa-chevron-up{elseif $order=="title DESC"}fa-chevron-down{else}fa-minus{/if}' style='color:#eee;' href='javascript:;'></i>
										</th>
										<th>分类<!--tmpl-orderth-->
										
										&nbsp;<i data-val='{if $order=="catid ASC"}catid DESC{else}catid ASC{/if}' class='fa ofield {if $order=="catid ASC"}fa-chevron-up{elseif $order=="catid DESC"}fa-chevron-down{else}fa-minus{/if}' style='color:#eee;' href='javascript:;'></i>
										</th>
										<th>添加时间<!--tmpl-orderth-->
										
										&nbsp;<i data-val='{if $order=="addtime ASC"}addtime DESC{else}addtime ASC{/if}' class='fa ofield {if $order=="addtime ASC"}fa-chevron-up{elseif $order=="addtime DESC"}fa-chevron-down{else}fa-minus{/if}' style='color:#eee;' href='javascript:;'></i>
										</th>
										<th>网址<!--tmpl-orderth-->
										
										&nbsp;<i data-val='{if $order=="url ASC"}url DESC{else}url ASC{/if}' class='fa ofield {if $order=="url ASC"}fa-chevron-up{elseif $order=="url DESC"}fa-chevron-down{else}fa-minus{/if}' style='color:#eee;' href='javascript:;'></i>
										</th>
										<th>LOGO<!--tmpl-orderth--></th>
										<th>类型<!--tmpl-orderth-->
										
										&nbsp;<i data-val='{if $order=="type ASC"}type DESC{else}type ASC{/if}' class='fa ofield {if $order=="type ASC"}fa-chevron-up{elseif $order=="type DESC"}fa-chevron-down{else}fa-minus{/if}' style='color:#eee;' href='javascript:;'></i>
										</th>
										<th>排序<!--tmpl-orderth-->
										
										&nbsp;<i data-val='{if $order=="listorder ASC"}listorder DESC{else}listorder ASC{/if}' class='fa ofield {if $order=="listorder ASC"}fa-chevron-up{elseif $order=="listorder DESC"}fa-chevron-down{else}fa-minus{/if}' style='color:#eee;' href='javascript:;'></i>
										</th>

										<th>操作人<!--tmpl-orderth-->

										&nbsp;<i href='javascript:;'></i>
										</th>
										<th>状态<!--tmpl-orderth-->
										
										&nbsp;<i data-val='{if $order=="status ASC"}status DESC{else}status ASC{/if}' class='fa ofield {if $order=="status ASC"}fa-chevron-up{elseif $order=="status DESC"}fa-chevron-down{else}fa-minus{/if}' style='color:#eee;' href='javascript:;'></i>
										</th>
								
										<th>操作</th>
									</tr>
								</thead>
								<tbody>
								{if empty($items)}
								<tr>
									<td style="text-align:center;" colspan="10" class="empty-table-td">{$emptyRecord}</td>
								</tr>
								{/if}
								{loop $items $value}
								<tr>
									<td><input type="checkbox" class="icheck" name="ids[]" value="{$value[id]}"/></td>
									<!--tmpl-fieldlist-->
								
									<td>{$value[title]}</td>
									<td>{$value[friendlink_cate_name]}</td>
									<td>{$value[addtime]}</td>
									<td>{$value[url]}</td>
									<td><img src='{$value[logo]}' height='40'></td>
									<td>{$value[type_text]}</td>
									<td>{$value[listorder]}</td>
									<td>{$value[manager_name]}</td>
									<td><input type='checkbox' data-id="{$value[id]}" data-on-text='启用' data-off-text='禁用' class='js-status bswitch' data-size='mini' {if $value[status]}checked{/if} ></td>
								
									<td>
										<!--tmpl-listbtn-->
								
										<!-- listbtnedit -->
										{if in_array('admin/friendlink/edit',$priv) || empty($priv)}
										<a href="{$edit_url}?id={$value[id]}" class="btn btn-primary btn-xs">
											<i class="glyphicon glyphicon-edit"></i> 编辑</a>
										{/if}
										
										<!-- listbtndelete -->
										{if in_array('admin/friendlink/delete',$priv) || empty($priv)}
										<a href="{$delete_url}?id={$value[id]}" class="btn btn-danger btn-xs item-remove">
											<i class="glyphicon glyphicon-trash"></i> 删除</a>
										{/if}
								
									</td>
								</tr>
								{/loop}
							</table>
						</div>
					</form>
					<div class="btn-group dropup" data-act="operateAll">
						<button type="button" class="btn btn-danger js-deletes" disabled>批量删除</button>
					</div>
					<div class="text-right">
						{$pagemenu}
					</div>
				</div>
			</div>
		</section>
	</div>
</div>

<!--footer section start-->
{include admin.inc.footer}
<!--footer section end-->

<!--tmpl-script-->
<script type="text/javascript">
	seajs.use("admin/setting_friendlinkindex",function (parameter){
		
		/**--tmpl-templatejavascript--**/
		
		<!--tmpl-templatejavascript-->

		parameter.admin_role_assoc_url="{$admin_role_assoc_url}";

		parameter.detailUrl="{$detail_url}";
		parameter.deleteUrl="{$delete_url}";
		parameter.editUrl="{$do_edit_url}";
		parameter.upload_url="{$upload_url}";
		parameter.image_search_url="{$image_search_url}";
		parameter.image_list_url="{$image_list_url}";
		
		parameter.init();		
	});
</script>

<!-- template -->
<script id="editpanel" type="text/html">
</script>
</body>
</html>
